You can execute callback actions on a hyperlink cell using the onClickAction method in the HyperLink class.
The following code sets a callback action to the hyperlink.
When the hyperlink is clicked by a user, the callback action will be executed. As a result, the sheet name will be changed to the name "Hyperlink" and the sheet tab color will be changed to red.
JavaScript |
Copy Code
|
---|---|
var h = new GC.Spread.Sheets.CellTypes.HyperLink(); h.text('Spread.Sheets Site'); h.linkColor('blue'); // Set a callback action to the hyperlink h.onClickAction(function () { // code to register this callback to the commandManager |
You can also control whether the active cell should be moved to the hyperlink cell when the hyperlink is clicked by a user using the activeOnClick method in the HyperLink class.
The following code can be used to get and set whether to move to the active cell when the hyperlink is clicked.
JavaScript |
Copy Code
|
---|---|
h.activeOnClick(true); |